﻿<UserControl x:Class="Microsoft.Research.ScientificWorkflow.ManagementStudioControls.RegistryManagerModule.ActivityCatalogCenterPane"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" 
    xmlns:Custom="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero">

    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="boolToVisibilityConverter"/>
        <ControlTemplate x:Key="ListViewItemControlTemplateBasic" TargetType="{x:Type ListViewItem}">
            <Border SnapsToDevicePixels="True" Margin="0,0,0,0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2,2,2,2">
                <Border x:Name="InnerBorder" BorderThickness="1,1,1,1" CornerRadius="1,1,1,1">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition MaxHeight="11" Height="*"/>
                        </Grid.RowDefinitions>
                        <GridViewRowPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.RowSpan="1" Content="{TemplateBinding Content}" Columns="{TemplateBinding GridView.ColumnCollection}"/>
                    </Grid>
                </Border>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background">
                        <Setter.Value>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFF1FBFF" Offset="0"/>
                                <GradientStop Color="#FFD5F1FE" Offset="1"/>
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                    <Setter Property="BorderBrush" Value="#FFCCF0FF"/>
                </Trigger>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background">
                        <Setter.Value>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFD9F4FF" Offset="0"/>
                                <GradientStop Color="#FF9BDDFB" Offset="1"/>
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                    <Setter Property="BorderBrush" Value="#FF98DDFB"/>
                    <Setter Property="BorderBrush" TargetName="InnerBorder" Value="#80FFFFFF"/>
                </Trigger>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsSelected" Value="True"/>
                        <Condition Property="Selector.IsSelectionActive" Value="False"/>
                    </MultiTrigger.Conditions>
                    <Setter Property="Background">
                        <Setter.Value>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFEEEDED" Offset="0"/>
                                <GradientStop Color="#FFDDDDDD" Offset="1"/>
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                    <Setter Property="BorderBrush" Value="#FFCFCFCF"/>
                </MultiTrigger>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsSelected" Value="True"/>
                        <Condition Property="IsMouseOver" Value="True"/>
                    </MultiTrigger.Conditions>
                    <Setter Property="Background">
                        <Setter.Value>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFEAF9FF" Offset="0"/>
                                <GradientStop Color="#FFC9EDFD" Offset="1"/>
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                    <Setter Property="BorderBrush" Value="#FF98DDFB"/>
                </MultiTrigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <Style x:Key="ListViewItemStyleBasic" TargetType="{x:Type ListViewItem}">
            <Setter Property="Template" Value="{DynamicResource ListViewItemControlTemplateBasic}"/>
        </Style>
        <DataTemplate x:Key="DataTemplate2">
            <Grid>
                <CheckBox HorizontalAlignment="Left" Name="requiredCheck" VerticalAlignment="Top" Content="Required" IsChecked="{Binding Path=Required, Mode=TwoWay}"/>                
            </Grid>
        </DataTemplate>
        <DataTemplate x:Key="DataTemplate3">
            <DockPanel HorizontalAlignment="Stretch" LastChildFill="True">
                <TextBox Width="138px" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalAlignment="Top" Text="{Binding Path=DefaultValue, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" TextWrapping="NoWrap" Name="valueText"/>
            </DockPanel>
        </DataTemplate>
        <SolidColorBrush x:Key="ListBorder" Color="#828790"/>
        <LinearGradientBrush x:Key="GridViewColumnHeaderBorderBackground" EndPoint="0,1" StartPoint="0,0">
            <GradientStop Color="#FFF2F2F2" Offset="0"/>
            <GradientStop Color="#FFD5D5D5" Offset="1"/>
        </LinearGradientBrush>
        <Style x:Key="GridViewColumnHeaderGripper" TargetType="{x:Type Thumb}">
            <Setter Property="Canvas.Right" Value="-9"/>
            <Setter Property="Width" Value="18"/>
            <Setter Property="Height" Value="{Binding Path=ActualHeight, RelativeSource={RelativeSource TemplatedParent}}"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="Background" Value="{StaticResource GridViewColumnHeaderBorderBackground}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Border Background="Transparent" Padding="{TemplateBinding Padding}">
                            <Rectangle HorizontalAlignment="Center" Width="1" Fill="{TemplateBinding Background}"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <ControlTemplate x:Key="GridViewColumnHeaderControlTemplate1" TargetType="{x:Type GridViewColumnHeader}">
            <Grid SnapsToDevicePixels="true">
                <Border x:Name="HeaderBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,1,0,1" Padding="2,2,2,2">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition MaxHeight="7"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Border Grid.RowSpan="2" Padding="{TemplateBinding Padding}">
                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="0,0,0,1" x:Name="HeaderContent" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
                        </Border>
                    </Grid>
                </Border>
                <Canvas>
                    <Thumb x:Name="PART_HeaderGripper" Style="{StaticResource GridViewColumnHeaderGripper}"/>
                </Canvas>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Background" TargetName="PART_HeaderGripper" Value="Transparent"/>
                    <Setter Property="Background" TargetName="HeaderBorder">
                        <Setter.Value>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFCDE7FF" Offset="0"/>
                                <GradientStop Color="#FFB2D8FF" Offset="1"/>
                                <GradientStop Color="#FF7FC0FF" Offset="0.371"/>
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                </Trigger>
                <Trigger Property="IsPressed" Value="true">
                    <Setter Property="Visibility" TargetName="PART_HeaderGripper" Value="Hidden"/>
                    <Setter Property="Margin" TargetName="HeaderContent" Value="1,1,0,0"/>
                    <Setter Property="Background" TargetName="HeaderBorder">
                        <Setter.Value>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFA8D0F5" Offset="0"/>
                                <GradientStop Color="#FF95CAFF" Offset="1"/>
                                <GradientStop Color="#FF5FA2E4" Offset="0.375"/>
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                </Trigger>
                <Trigger Property="Height" Value="Auto">
                    <Setter Property="MinHeight" Value="20"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <Style x:Key="ButtonStyleImportBtn" BasedOn="{x:Null}" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid x:Name="resume_grid">
                            <Ellipse Stroke="#CCFFFFFF" StrokeThickness="2" x:Name="playbuttonbg2">
                                <Ellipse.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF0D7BB3" Offset="0"/>
                                        <GradientStop Color="#FF83C6EC" Offset="1"/>
                                    </LinearGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Path Stretch="Fill" Stroke="{x:Null}" StrokeThickness="1.5" Height="11.621" Data="M8.6253329,12.875359 C11.792333,4.0427084 19.500333,5.500333 19.500333,5.500333 30.125334,6.7505247 29.625335,16.875153 29.625335,16.875153 21.750333,10.6254 8.6253329,12.875359 8.6253329,12.875359 z" x:Name="playbuttonshade2" Margin="3.793,3.087,3.036,0" VerticalAlignment="Top">
                                <Path.Fill>
                                    <LinearGradientBrush EndPoint="0.433,0.701" StartPoint="0.5,0">
                                        <GradientStop Color="#B2FFFFFF" Offset="0"/>
                                        <GradientStop Color="#00FFFFFF" Offset="1"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                            <Rectangle Stroke="{x:Null}" Margin="0,11.535,6.12,10.087" x:Name="rectangle1_Copy" Fill="#FFFFFFFF" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Right" Width="4.384">
                                <Rectangle.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="37.97"/>
                                        <TranslateTransform X="0" Y="0"/>
                                    </TransformGroup>
                                </Rectangle.RenderTransform>
                            </Rectangle>
                            <Path Opacity="1" HorizontalAlignment="Stretch" Margin="8.709,3.311,4.061,4.902" VerticalAlignment="Stretch" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="0.5" RenderTransformOrigin="0.5,0.5">
                                <Path.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="35.886"/>
                                        <TranslateTransform X="-2.3782011338001663" Y="0.813030063743788"/>
                                    </TransformGroup>
                                </Path.RenderTransform>
                                <Path.Fill>
                                    <LinearGradientBrush EndPoint="0.433,0.701" StartPoint="0.5,0">
                                        <GradientStop Color="#FF62A6CA" Offset="0"/>
                                        <GradientStop Color="#FF13567A" Offset="1"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                                <Path.Data>
                                    <PathGeometry>
                                        <PathFigure IsClosed="True" StartPoint="12.2862889476927,1.72296947397552">
                                            <BezierSegment Point1="12.2862867973476,1.72283460713164" Point2="2.6854072690463,9.44088693601672" Point3="2.64077639691748,9.44189576988705"/>
                                            <BezierSegment Point1="2.59657832922275,9.44289482066887" Point2="-7.04606902986198,1.29823697393066" Point3="-6.99668339995603,1.29831151549898" IsSmoothJoin="True"/>
                                            <PolyBezierSegment Points="-6.9810043,1.2983352 -0.28997423,1.7313146 -0.29207358,1.73105 -0.33151494,1.7260784 1.505724,-7.0807176 7.3161624,-10.294247 7.3526222,-10.314412 3.2487756,-5.8249012 4.9251608,1.5188751"/>
                                            <BezierSegment Point1="4.94199283988763,1.59261174487916" Point2="12.2862907657568,1.72308350059099" Point3="12.2862889476927,1.72296947397552" IsSmoothJoin="True"/>
                                        </PathFigure>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                            <Rectangle Stroke="{x:Null}" Margin="10.427,4.997,11.313,0" x:Name="rectangle1_Copy1" Fill="#FFFFFFFF" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Top" Height="4.254">
                                <Rectangle.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="31.498"/>
                                        <TranslateTransform X="0" Y="0"/>
                                    </TransformGroup>
                                </Rectangle.RenderTransform>
                            </Rectangle>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsFocused" Value="True"/>
                            <Trigger Property="IsDefaulted" Value="True"/>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Fill" TargetName="playbuttonbg2">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF095A84" Offset="0"/>
                                            <GradientStop Color="#FF53A4D2" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter Property="Fill" TargetName="playbuttonbg2">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF0091DA" Offset="0"/>
                                            <GradientStop Color="#FF00314D" Offset="0.996"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                                <Setter Property="Fill" TargetName="playbuttonshade2">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.433,0.701" StartPoint="0.5,0">
                                            <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                            <GradientStop Color="#00FFFFFF" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Fill" TargetName="playbuttonbg2">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF828282" Offset="0"/>
                                            <GradientStop Color="#FFEAEAEA" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <ControlTemplate x:Key="TextBoxErrorTemplate">
            <DockPanel>
                <Grid DockPanel.Dock="Left" Margin="0,-8,-3,0" Width="12" Height="12" ToolTip="Invalid data entered.">
                <Ellipse Fill="#FFC42A2A" Stroke="{x:Null}"/>
                <Path Fill="#FFFFFFFF" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="2" Margin="4.94,2.235,4.644,5.12" Data="M11.701627,8.0009042 L12.372672,15.173164 14.011686,15.241177 14.56827,7.8270056 z"/>
                <Path Fill="#FFFFFFFF" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="2" Margin="5.121,0,4.779,1.746" VerticalAlignment="Bottom" Height="2.1" Data="M11.395564,17.238573 L14.853121,17.333691 14.771832,21.163108 11.102494,20.999791 z"/>
            </Grid>
            <AdornedElementPlaceholder />
            </DockPanel>
        </ControlTemplate>
        <Style TargetType="TextBox">
            <Setter Property="Margin" Value="4,4,10,4" />
            <Setter Property="Validation.ErrorTemplate" Value="{StaticResource TextBoxErrorTemplate}"/>
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="True">
                    <Setter Property="ToolTip">
                        <Setter.Value>
                            <Binding Path="(Validation.Errors)[0].ErrorContent" RelativeSource="{x:Static RelativeSource.Self}"/>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,0.665" StartPoint="0.5,0">
                <GradientStop Color="#FFFFFFFF" Offset="0"/>
                <GradientStop Color="#FFF3F3F3" Offset="1"/>
            </LinearGradientBrush>
        </Grid.Background>
        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0">
            <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="4,4,4,4" BorderThickness="1,1,1,1" 
                        Background="#FFFFFFFF" BorderBrush="#FFE0E0E0">
                <Grid Margin="0,0,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="36"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    
                    <!--The buttons on the top, like a toolbar.-->
                    <Border CornerRadius="5,5,0,0" Grid.Row="1">
                        <Border.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFFBFBFB" Offset="0"/>
                                <GradientStop Color="#FFF0F0F0" Offset="1"/>
                            </LinearGradientBrush>
                        </Border.Background>
                        <StackPanel Orientation="Horizontal">
                            <Button Style="{DynamicResource ButtonStyleImportBtn}" Command="{Binding Path=ImportActivityCommand}" Width="26" Height="26" Content="Button"  AutomationProperties.AutomationId="btnImport" ToolTip="Import" Margin="5,0,0,0"/>
                            <Button Style="{DynamicResource WorkflowDelete}" Width="26"  Command="{Binding Path=DeleteActivityCommand}" Height="26" Content="Button" AutomationProperties.AutomationId="btnDelete" ToolTip="Delete" Margin="5,0,0,0" />
                        </StackPanel>
                    </Border>
                    
                    <!--Main area of the center pane-->
                        <Grid VerticalAlignment="Stretch" Margin="5,5,5,5" Grid.Row="2"  Grid.RowSpan="2" >
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" MinHeight="67.104"/>
                                <RowDefinition Height="*"/>
                            <RowDefinition Height="40"/>
                        </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid HorizontalAlignment="Stretch" Margin="0,0,0,0" Grid.ColumnSpan="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="72"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Image Width="72" HorizontalAlignment="Left" Source="/Microsoft.Research.ScientificWorkflow.TridentUtilities;component/Images/ManagementStudio/activitesHeaderPic.png"  d:LayoutOverrides="HorizontalAlignment" VerticalAlignment="Top"/>
                                <TextBlock TextAlignment="Justify"
                                           AutomationProperties.AutomationId="txtblkDescriptive" VerticalAlignment="Top" TextWrapping="Wrap" d:LayoutOverrides="Width" Margin="10,0,0,0" Grid.Column="1">
                                    <Run Text="Activity is the integral part of the workflow.  Each activity would take some input, process it and provide an output. This catalog provides the interface for editing the basic details for the activity.  The changes will be saved in the registry and will be reflected wherever the activity is used.  The creation details of the activity can also be edited in this catalog."/>
                                </TextBlock>
								</Grid>
                        <!--Save and cancel buttons-->
                        <Border BorderBrush="#FFC1C1C1" BorderThickness="0,1,0,0" Padding="0,10,0,0" Margin="0,10,0,0" Grid.Row="2">
                            <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                <Button AutomationProperties.AutomationId="btnSave" Command="{Binding Path=SaveActivityChangesCommand}" HorizontalAlignment="Right" VerticalAlignment="Top" Width="70" Content="Save" Margin="0,0,100,0"/>
                                <Button AutomationProperties.AutomationId="btnCancel" Command="{Binding Path=CancelActivityChangesCommand}" HorizontalAlignment="Right" Width="70" Content="Cancel" d:LayoutOverrides="Height" Margin="0,0,20,0" VerticalAlignment="Top"/>
                            </Grid>
                        </Border>
                        <ScrollViewer Grid.Row="1" Grid.RowSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                            <StackPanel Margin="0,0,0,0" >
                                <!--Activity metadata-->
                                <Border CornerRadius="5,5,5,5" BorderThickness="0,0,0,0" BorderBrush="#FFC4C4C4" Background="#FFFFFFFF" Margin="60,15,10,0">
                                    <Grid Margin="0,0,0,0">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="125"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" MinHeight="20.2"/>
                                            <RowDefinition Height="Auto" MinHeight="6.76000000000001"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <!--<RowDefinition Height="Auto" MinHeight="18.52"/>
                                            <RowDefinition Height="Auto" MinHeight="7.51999999999998"/>-->
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto" MinHeight="19.44"/>
                                            <RowDefinition Height="Auto" MinHeight="19.44"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto" MinHeight="19.48"/>
                                            <RowDefinition Height="Auto" MinHeight="7.48000000000002"/>
                                        </Grid.RowDefinitions>
                                        <TextBlock AutomationProperties.AutomationId="idLabel" HorizontalAlignment="Right" VerticalAlignment="Top" Text="ID:" TextWrapping="Wrap" Margin="0,5,5,0"/>
                                            <Grid VerticalAlignment="Top" Grid.Row="2" Margin="0,5,8,0" HorizontalAlignment="Right">
                                                <Grid Margin="0,-0.5,-7.5,0" Width="8" Height="8" HorizontalAlignment="Right" VerticalAlignment="Top">
                                                    <Path RenderTransformOrigin="0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Fill="#FFFF0000" Stretch="Fill" StrokeThickness="0" Data="M18.597656,17.335052 L25.59375,17.335052 L25.382813,29.253021 L36.210938,22.010834 L39.832031,27.424896 L27.667969,34.561615 L39.832031,41.768646 L36.210938,47.112396 L25.242188,39.624115 L25.628906,51.85849 L18.597656,51.85849 L18.808594,39.975677 L8.0859375,47.147552 L4.5,41.73349 L16.59375,34.596771 L4.5703125,27.38974 L8.0859375,21.975677 L18.808594,29.253021 z">
                                                        <Path.RenderTransform>
                                                            <TransformGroup>
                                                                <ScaleTransform ScaleX="0.7" ScaleY="0.7"/>
                                                                <SkewTransform AngleX="0" AngleY="0"/>
                                                                <RotateTransform Angle="0"/>
                                                                <TranslateTransform X="0" Y="0"/>
                                                            </TransformGroup>
                                                        </Path.RenderTransform>
                                                    </Path>
                                                </Grid>
                                                <TextBlock Margin="-2,0,0,0" AutomationProperties.AutomationId="labellabel" HorizontalAlignment="Right" Text="Label:" TextWrapping="Wrap"/>
                                            </Grid>
                                            <TextBox AutomationProperties.AutomationId="actLabel" HorizontalAlignment="Left" Width="250" MaxLength="75" ToolTip="{Binding Path=EditableActivityViewModel.Label}" ToolTipService.ShowOnDisabled="True" Text="{Binding Path=EditableActivityViewModel.Label, UpdateSourceTrigger=PropertyChanged}" TextWrapping="NoWrap" Margin="0,5,0,0" d:LayoutOverrides="Height" Grid.Column="1" Grid.Row="2" VerticalAlignment="Top"/>
                                            <TextBox AutomationProperties.AutomationId="description" ToolTip="{Binding Path=EditableActivityViewModel.Description}" Text="{Binding Path=EditableActivityViewModel.Description, UpdateSourceTrigger=PropertyChanged}"  MaxLength="300" TextWrapping="Wrap" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" Width="250" Grid.Column="1" Grid.Row="3" VerticalScrollBarVisibility="Auto" Grid.RowSpan="1" Height="45"/>
											<TextBlock AutomationProperties.AutomationId="descLabel" HorizontalAlignment="Right" Text="Description:" TextWrapping="Wrap" d:LayoutOverrides="Height" Grid.Row="3" Margin="0,5,5,0" VerticalAlignment="Top"/>
											<TextBlock AutomationProperties.AutomationId="img" Text="Icon:" TextWrapping="Wrap" VerticalAlignment="Top" d:LayoutOverrides="Width" Grid.Row="6" Margin="0,5,5,0" HorizontalAlignment="Right"/>
                                            <TextBlock AutomationProperties.AutomationId="author" Text="Author:" TextWrapping="Wrap" d:LayoutOverrides="Width, Height" Grid.Row="8" Margin="0,5,5,0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
                                            <TextBlock AutomationProperties.AutomationId="createdDate" Text="Created Date:" TextWrapping="Wrap" d:LayoutOverrides="Width, Height" Grid.Row="10" Margin="0,5,5,0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
											<TextBlock AutomationProperties.AutomationId="modifieddate" Text="Modified By:" TextWrapping="Wrap" Margin="0,5,5,0" d:LayoutOverrides="Width, Height" Grid.Row="11" HorizontalAlignment="Right" VerticalAlignment="Top"/>
											<TextBlock AutomationProperties.AutomationId="modifiedBy" Text="Modified Date:" TextWrapping="Wrap" Margin="0,5,5,0" d:LayoutOverrides="Width, Height" Grid.Row="12" VerticalAlignment="Top" HorizontalAlignment="Right"/>
											<TextBox AutomationProperties.AutomationId="id" Text="{Binding Path=EditableActivityViewModel.Id}" ToolTip="{Binding Path=EditableActivityViewModel.Id}" ToolTipService.ShowOnDisabled="True" TextWrapping="Wrap" d:LayoutOverrides="Height" Grid.Column="1" Grid.Row="0" Width="250" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,5,0,0" IsEnabled="False"/>
											<Grid HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Column="1" Grid.Row="4" Margin="0,5,0,0">
												<Grid.RowDefinitions>
													<RowDefinition Height="Auto"/>
												</Grid.RowDefinitions>
												<TextBox AutomationProperties.AutomationId="categoryPath" Text="{Binding Path=EditableActivityViewModel.ParentBreadcrumb}" IsEnabled="False" ToolTipService.ShowOnDisabled="True" ToolTip="{Binding Path=EditableActivityViewModel.ParentBreadcrumb}" TextWrapping="NoWrap" Margin="0,0,0,0" Width="250" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.RowSpan="1"/>
												<Button AutomationProperties.AutomationId="categoryBrowse" Command="{Binding Path=BrowseCategoryCommand}" HorizontalAlignment="Left" VerticalAlignment="Top" Content="..." ToolTip="Browse" Width="30" Margin="255,0,0,0" Grid.RowSpan="1"/>
											</Grid>
                                            <TextBlock AutomationProperties.AutomationId="versionLabel" Text="Version:" TextWrapping="Wrap" Margin="0,5,5,0" d:LayoutOverrides="Width, Height" Grid.Row="5" VerticalAlignment="Top" HorizontalAlignment="Right"/>
                                            <TextBox AutomationProperties.AutomationId="versionTextBx" ToolTipService.ShowOnDisabled="True" ToolTip="{Binding Path=EditableActivityViewModel.Version}" Text="{Binding Path=EditableActivityViewModel.Version}" HorizontalAlignment="Left" Margin="0,5,0,0" IsEnabled="False" VerticalAlignment="Top" Width="250" Grid.Column="1" Grid.Row="5" VerticalScrollBarVisibility="Auto" Grid.RowSpan="1"/>
                                            <TextBlock AutomationProperties.AutomationId="categoryLabel" Text="Category:" TextWrapping="Wrap" Margin="0,5,5,0" VerticalAlignment="Top" d:LayoutOverrides="Width" HorizontalAlignment="Right" Grid.Row="4"/>
											<Grid HorizontalAlignment="Stretch" Margin="0,6,0,0" d:LayoutOverrides="Margin" Grid.Column="1" Grid.Row="6">
												<Grid.RowDefinitions>
													<RowDefinition Height="Auto" MinHeight="19.32"/>
													<RowDefinition Height="Auto" MinHeight="17.68"/>
												</Grid.RowDefinitions>
												<Grid.ColumnDefinitions>
													<ColumnDefinition Width="Auto"/>
													<ColumnDefinition Width="Auto"/>
												</Grid.ColumnDefinitions>
												<Button AutomationProperties.AutomationId="imgBrowse" HorizontalAlignment="Left" VerticalAlignment="Top" Content="Browse" ToolTip="Browse" Command="{Binding Path=BrowseImageCommand}" Width="70" Grid.RowSpan="1" Margin="10,0,0,0" Grid.Column="1"/>
												<Button AutomationProperties.AutomationId="imgDefault" HorizontalAlignment="Left" VerticalAlignment="Top" Content="Use Default" ToolTip="Use Default" Command="{Binding Path=RevertToDefIconCommand}" Width="70" Grid.RowSpan="1" Margin="10,2,0,0" Grid.Row="1" Grid.Column="1"/>
											    <Border BorderBrush="LightGray" CornerRadius="3" MaxHeight="50" MaxWidth="50" BorderThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2">
                                                    <Image AutomationProperties.AutomationId="img" Width="50">
                                                        <Image.Source>
                                                            <PriorityBinding FallbackValue="EditableActivityViewModel.DefaultImage">
                                                                <Binding Path="EditableActivityViewModel.PreviewImage" IsAsync="True"/>
                                                                <Binding Path="EditableActivityViewModel.RegistryImage" IsAsync="True"/>
                                                                <Binding Path="EditableActivityViewModel.DefaultImage"/>
                                                            </PriorityBinding>
                                                        </Image.Source>
                                                    </Image>
                                                </Border>
											</Grid>
											<TextBlock HorizontalAlignment="Right" Text="Name:" TextWrapping="Wrap" Margin="0,5,5,0" d:LayoutOverrides="Height" Grid.Row="1" VerticalAlignment="Top"/>
											<TextBox AutomationProperties.AutomationId="activityName" HorizontalAlignment="Left" Width="250" MaxLength="75" IsEnabled="False" Text="{Binding Path=EditableActivityViewModel.Name, UpdateSourceTrigger=PropertyChanged}" ToolTip="{Binding Path=EditableActivityViewModel.Name}" ToolTipService.ShowOnDisabled="True" TextWrapping="NoWrap" Margin="0,5,0,0" d:LayoutOverrides="Height" Grid.Column="1" Grid.Row="1" VerticalAlignment="Top"/>											
											<TextBlock AutomationProperties.AutomationId="keywordsLabel" Text="Keywords:" TextWrapping="Wrap" d:LayoutOverrides="Width, Height" Grid.Row="7" HorizontalAlignment="Right" Margin="0,5,5,0" VerticalAlignment="Top"/>
											<StackPanel HorizontalAlignment="Left" Width="260" Grid.Column="1" Grid.Row="7" VerticalAlignment="Top" Margin="0,5,0,0">
												<TextBox AutomationProperties.AutomationId="keywordsText" Text="{Binding Path=EditableActivityViewModel.Keywords}" ToolTip="{Binding Path=EditableActivityViewModel.Keywords}" TextWrapping="Wrap" HorizontalAlignment="Stretch" MaxLength="300" MaxLines="3" VerticalScrollBarVisibility="Auto" d:LayoutOverrides="Height" />
												<TextBlock AutomationProperties.AutomationId="keywordsHelpText" Foreground="#FF999999" Text="Separate keywords with semicolon" TextWrapping="Wrap"/>
											</StackPanel>
                                            <TextBox AutomationProperties.AutomationId="authorText" ToolTip="{Binding Path=EditableActivityViewModel.Author}" Text="{Binding Path=EditableActivityViewModel.Author}" ToolTipService.ShowOnDisabled="True" TextWrapping="Wrap" d:LayoutOverrides="Height" Grid.Row="8" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="250" Margin="0,5,0,0" MaxLength="300" MaxLines="3"/>
                                            <TextBox AutomationProperties.AutomationId="createdDateText" ToolTip="{Binding Path=EditableActivityViewModel.CreatedDate}" Text="{Binding Path=EditableActivityViewModel.CreatedDate}" ToolTipService.ShowOnDisabled="True" TextWrapping="Wrap" d:LayoutOverrides="Height" Grid.Row="10" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="250" Margin="0,5,0,0" IsEnabled="False"/>
											<TextBox AutomationProperties.AutomationId="lastModifiedText" ToolTip="{Binding Path=EditableActivityViewModel.LastModifiedTime}" Text="{Binding Path=EditableActivityViewModel.LastModifiedTime}" ToolTipService.ShowOnDisabled="True" TextWrapping="Wrap" Margin="0,5,0,0" d:LayoutOverrides="Height" Grid.Row="12" HorizontalAlignment="Left" VerticalAlignment="Top" Width="250" Grid.Column="1" IsEnabled="False"/>
											<TextBlock AutomationProperties.AutomationId="importedByText" Text="Imported By:" TextWrapping="Wrap" Margin="0,5,5,0" d:LayoutOverrides="Width, Height" Grid.Row="9" HorizontalAlignment="Right" VerticalAlignment="Top"/>
											<TextBox AutomationProperties.AutomationId="createdByText" ToolTip="{Binding Path=EditableActivityViewModel.CreatedBy}" Text="{Binding Path=EditableActivityViewModel.CreatedBy}" ToolTipService.ShowOnDisabled="True" TextWrapping="Wrap" HorizontalAlignment="Left" Margin="0,5,0,0" Width="250" d:LayoutOverrides="Height" Grid.Column="1" Grid.Row="9" VerticalAlignment="Top" IsEnabled="False"/>
											<TextBox AutomationProperties.AutomationId="lastModifiedBy" Text="{Binding Path=EditableActivityViewModel.LastModifiedBy}" ToolTip="{Binding Path=EditableActivityViewModel.LastModifiedBy}" ToolTipService.ShowOnDisabled="True" TextWrapping="Wrap" HorizontalAlignment="Left" Margin="0,5,0,0" Width="250" IsEnabled="False" d:LayoutOverrides="Height" Grid.Column="1" Grid.Row="11"/>
										</Grid>
                                </Border>

                                <!--Input parameters-->
                                <Border CornerRadius="5,5,5,5" BorderThickness="1,1,1,1" BorderBrush="#FFD6D6D6" Background="#FFFFFFFF" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0,10,20,10">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="20"/>
                                            <RowDefinition Height="*"/>
                                        </Grid.RowDefinitions>
                                        <Border HorizontalAlignment="Stretch" Grid.RowSpan="1" CornerRadius="6,6,0,0" BorderThickness="0,0,0,1" BorderBrush="#FFE4E4E4">
                                            <Border.Background>
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                    <GradientStop Color="#FFEEEEEE" Offset="0"/>
                                                    <GradientStop Color="#FFFFFFFF" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Border.Background>
                                            <TextBlock AutomationProperties.AutomationId="inputParamsHeader" Text="Input Parameters" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,0,0,0" FontSize="12"/>
											</Border>
                                        <TextBlock Visibility="{Binding Converter={StaticResource boolToVisibilityConverter}, Path=EditableActivityViewModel.HasNoInputParameter}" Text="No items to be shown" Opacity="0.7" HorizontalAlignment="Center" VerticalAlignment="Center" AutomationProperties.AutomationId="inputParamsNoItems" Grid.Row="1"  Margin="0,5,0,5"/>
                                        <ListView SelectionMode="Single"
                                            Visibility="{Binding Converter={StaticResource boolToVisibilityConverter}, Path=EditableActivityViewModel.HasInputParameters}" 
                                                  ItemsSource="{Binding Path=EditableActivityViewModel.InputParameters}" MaxHeight="150" 
                                                  AutomationProperties.AutomationId="inputParamsListVw" 
                                                  BorderBrush="#FFD7D7D7" VerticalAlignment="Top" Grid.Row="1" 
                                                  HorizontalAlignment="Stretch" Margin="10,10,10,10"
                                                  ItemContainerStyle="{DynamicResource ListViewItemStyleBasic}" 
                                                  Style="{DynamicResource ListViewStyle1}" IsSynchronizedWithCurrentItem="True">
                                            <ListView.View>                                                
                                                <GridView>
                                                    <GridViewColumn Header="Parameter Name" DisplayMemberBinding="{Binding Path=ParameterLabel}" Width="150px" />
                                                    <GridViewColumn Header="Data Type" DisplayMemberBinding="{Binding Path=DataType}" Width="150px" />
                                                    <GridViewColumn CellTemplate="{DynamicResource DataTemplate2}" Header="Required" Width="150px"/>
                                                    <GridViewColumn Header="Default Value" CellTemplate="{DynamicResource DataTemplate3}" Width="160px"/>
                                                </GridView>
                                            </ListView.View>
                                        </ListView>
                                    </Grid>
                                </Border>

                                <!--Output parameters-->
                                <Border CornerRadius="5,5,5,5" BorderThickness="1,1,1,1" BorderBrush="#FFD6D6D6" Background="#FFFFFFFF" Height="Auto" Margin="0,0,20,10">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="20"/>
                                            <RowDefinition Height="*"/>
                                        </Grid.RowDefinitions>
                                        <Border HorizontalAlignment="Stretch" Grid.RowSpan="1" CornerRadius="6,6,0,0" BorderThickness="0,0,0,1" BorderBrush="#FFE4E4E4">
                                            <Border.Background>
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                    <GradientStop Color="#FFEEEEEE" Offset="0"/>
                                                    <GradientStop Color="#FFFFFFFF" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Border.Background>
                                            <TextBlock AutomationProperties.AutomationId="outputParamsHeader" Text="Output Parameters" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,0,0,0" FontSize="12"/>
											</Border>
                                        <TextBlock Visibility="{Binding Converter={StaticResource boolToVisibilityConverter}, Path=EditableActivityViewModel.HasNoOutputParameters}" Text="No items to be shown" Opacity="0.7" HorizontalAlignment="Center" VerticalAlignment="Center" AutomationProperties.AutomationId="outputParamsNoItems" Grid.Row="1" Margin="0,5,0,5"/>
                                        <ListView SelectionMode="Single"
                                            Visibility="{Binding Converter={StaticResource boolToVisibilityConverter}, Path=EditableActivityViewModel.HasOutputParameters}"
                                                  MaxHeight="150" 
                                                  AutomationProperties.AutomationId="outputParamsListVw" BorderBrush="#FFD7D7D7" 
                                                  VerticalAlignment="Bottom" Grid.Row="1" Margin="10,10,10,10"
                                                  ItemContainerStyle="{DynamicResource ListViewItemStyleBasic}"
                                                  ItemsSource="{Binding Path=EditableActivityViewModel.OutputParameters}"
                                                  Style="{DynamicResource ListViewStyle1}" IsSynchronizedWithCurrentItem="True">
                                            <ListView.View>
                                                <GridView>
                                                    <GridViewColumn Header="Parameter Name" DisplayMemberBinding="{Binding Path=ParameterLabel}" Width="150px" />
                                                    <GridViewColumn Header="Data Type" DisplayMemberBinding="{Binding Path=DataType}" Width="150px" />
                                                </GridView>
                                            </ListView.View>
                                        </ListView>
                                    </Grid>
                                </Border>

                                <!--Related workflows-->
                                <Border CornerRadius="5,5,5,5" BorderThickness="1,1,1,1" BorderBrush="#FFD6D6D6" Background="#FFFFFFFF" Margin="0,0,20,0">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="20"/>
                                            <RowDefinition Height="*"/>
                                        </Grid.RowDefinitions>
                                        <Border HorizontalAlignment="Stretch" Grid.RowSpan="1" CornerRadius="6,6,0,0" BorderThickness="0,0,0,1" BorderBrush="#FFE4E4E4">
                                            <Border.Background>
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                    <GradientStop Color="#FFEEEEEE" Offset="0"/>
                                                    <GradientStop Color="#FFFFFFFF" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Border.Background>
                                            <TextBlock AutomationProperties.AutomationId="relatedWfsHeader" Text="Related Workflows" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,0,0,0" FontSize="12"/>
											</Border>
                                        <TextBlock Visibility="{Binding Converter={StaticResource boolToVisibilityConverter}, Path=EditableActivityViewModel.HasNoRelatedWorkflows}"
                                            Text="No items to be shown" Opacity="0.7" HorizontalAlignment="Center" VerticalAlignment="Center" AutomationProperties.AutomationId="relatedNoItems" Grid.Row="1"  Margin="0,5,0,5"/>
                                        <ListView Visibility="{Binding Converter={StaticResource boolToVisibilityConverter}, Path=EditableActivityViewModel.HasRelatedWorkflows}"
                                            SelectionMode="Single" AutomationProperties.AutomationId="relatedWfsListVw" MaxHeight="150" 
                                                  IsSynchronizedWithCurrentItem="True" 
                                                  ItemContainerStyle="{DynamicResource ListViewItemStyleBasic}" BorderBrush="#FFD7D7D7" 
                                                  Style="{DynamicResource ListViewStyle1}" VerticalAlignment="Top" Grid.Row="1" 
                                                  ItemsSource="{Binding Path=EditableActivityViewModel.RelatedWorkflows}"
                                                  Margin="10,10,10,10">
                                            <ListView.View>
                                                <GridView>
                                                    <GridViewColumn Header="Workflow Name" DisplayMemberBinding="{Binding Path=Label}" Width="150px" />
                                                    <GridViewColumn Header="Version" DisplayMemberBinding="{Binding Path=Version}" Width="30"/>
                                                    <GridViewColumn Header="Created By" DisplayMemberBinding="{Binding Path=Author}" Width="150px" />
                                                    <GridViewColumn Header="Last Updated" DisplayMemberBinding="{Binding Path=LastModifiedTime}" Width="150px" />
                                                </GridView>
                                            </ListView.View>
                                        </ListView>
                                    </Grid>
                                </Border>

                            </StackPanel>
                        </ScrollViewer>
                    </Grid>
                    
                    
                    <Border Margin="0,0,0,0" CornerRadius="5,5,0,0" BorderThickness="0,0,0,1" Grid.Row="0" BorderBrush="#FFFFFFFF">
                        <Border.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                <GradientStop Color="#FFE8E8E8" Offset="1"/>
                            </LinearGradientBrush>
                        </Border.Background>
                        <TextBlock AutomationProperties.AutomationId="mainHeader" Text="Activity" TextWrapping="Wrap" FontSize="14" FontWeight="Normal" Margin="7,2,0,0"/>
					</Border>
                </Grid>
            </Border>
        </Grid>
    </Grid>
</UserControl>
